package com.ty.domethymeleaf.controller;

import com.ty.domethymeleaf.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class Testcontroller {

    @RequestMapping("/t1")
    public String test1(Model model){
        model.addAttribute("msg","hello,Thymeleaf");
        User user = new User();
        user.setName("小红");
        user.setTalk(170.3);
        user.setSpeaking("我的身高是");
        model.addAttribute("user",user);
//      返回页面名，templates/test.html
        return "test";
//        测试分支
    }

}
